Skip to content

Feat: Implement qr code generation and scanning#2580

Open
yp-amnezia wants to merge 45 commits into
devfrom
feat/implement-QR-code-generation-and-scanning
Open

Feat: Implement qr code generation and scanning#2580
yp-amnezia wants to merge 45 commits into
devfrom
feat/implement-QR-code-generation-and-scanning

Conversation

@yp-amnezia
Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread tools/local_gateway/main.go Outdated
Done: make(chan struct{}),
}

mu.Lock()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вот здесь нужно добавить проверку на существование такого же qr_uuid. Если существует, вернуть 409

mu.Lock()
cleanupExpiredSessions(time.Now())
if _, exists := sessions[req.QRUUID]; exists {
    mu.Unlock()
    writeJSON(w, http.StatusConflict, map[string]string{
        "message": "Conflict: QR session with this UUID already exists.",
    })
    return
}
sessions[req.QRUUID] = session
mu.Unlock()

Comment thread tools/local_gateway/main.go Outdated
// Keep compatibility with current gateway behavior: key problems are mapped to 403.
if req.AuthData.APIKey == "invalid" {
writeJSON(w, http.StatusForbidden, map[string]string{
"detail": "Forbidden: Invalid API key or unauthorized request.",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Использовать поле message вместо detail

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants